package demo.day13

//Kotlin 过滤函数 filter
fun main() {
    val nameLists = listOf(
        listOf("a", "b", "c"),
        listOf("aa", "bb", "cc"),
        listOf("aaa", "bbb", "ccc")
    )
    nameLists.map {
        //it == nameLists的元素
        println(it)
    }
    println("<==================================================>")

    nameLists.flatMap {
        println(it)
        it
    }
    println("<==================================================>")
    nameLists.flatMap { it ->
        it.filter {
            // 如果为true 会加入到一个新的集合 进行组合组装 如果是false 则过滤掉
            !it.contains('a')
        }.map {
            print(it)
        }
    }
}